import router from './router/router'
import  'reset-css'
import Element from 'element-plus'
import 'element-plus/dist/index.css'
import * as e from '@element-plus/icons-vue'
import './assets/style/commnet.css'
import store from './store/store'


import { createApp } from 'vue'
import App from './App.vue'


const app = createApp(App)

app.use(store)

router.beforeEach((to,from)=>{
    if(to.matched.length == 0){
        console.log('404');
        return '/404'
    }
})


let keys = {
    Menu:'iconMenu'
}

for  (let k of Object.keys(e)){
    app.component(keys[k] ?? k,e[k])
}
app.use(Element)
app.use(router)
app.mount('#app')
